package com.gzlz.budejie.utils;

import android.view.View;
import android.widget.ImageView;

import com.gzlz.budejie.MyApplication;
import com.lidroid.xutils.BitmapUtils;
import com.lidroid.xutils.bitmap.BitmapDisplayConfig;
import com.lidroid.xutils.bitmap.callback.BitmapLoadCallBack;
import com.lidroid.xutils.bitmap.callback.DefaultBitmapLoadCallBack;

public class BMUtils {
	static BitmapUtils bitmapUtils ;
	
	public static  <T extends View> void display(T container, String uri,BitmapDisplayConfig config, DefaultBitmapLoadCallBack<T> callBack){
		if (bitmapUtils==null) {
			bitmapUtils = new BitmapUtils(MyApplication.getApplication());
		}
		bitmapUtils.display(container, uri,config, callBack);
	}
	
	public static  <T extends View> void display(T container, String uri, BitmapLoadCallBack<T> callBack){
		if (bitmapUtils==null) {
			bitmapUtils = new BitmapUtils(MyApplication.getApplication());
		}
		bitmapUtils.display(container, uri, callBack);
	}
	
	public static  <T extends View> void display(T container, String uri){
		if (bitmapUtils==null) {
			bitmapUtils = new BitmapUtils(MyApplication.getApplication());
		}
		bitmapUtils.display(container, uri);
	}

	public static <T extends View> void display(T container,
			String url, BitmapDisplayConfig bigPicDisplayConfig) {
		if (bitmapUtils==null) {
			bitmapUtils = new BitmapUtils(MyApplication.getApplication());
		}
		bitmapUtils.display(container, url,bigPicDisplayConfig);
	}
	
}
